Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable automatic __typename selection and fix client runtime errors connected to it #773

Merged
merged 16 commits into from
Oct 18, 2022

Conversation

nalchevanidze
Copy link
Member

@nalchevanidze nalchevanidze commented Oct 18, 2022

  • GQL app does not automatically insert __typename field on union selections
  • GQL client does not generates only the datatypes for casted union types +1 type for fallback
  • not selecting __typename on clients does not causes runtime error, however client will decode it as fallback type
  • if you forgot to select __typename on unions, morpheus client will warn you about it.

fixes #687
fixes #509

@nalchevanidze nalchevanidze marked this pull request as ready for review October 18, 2022 19:26
@nalchevanidze nalchevanidze added scope/client morpheus-graphql-client pr/breaking Breaking Change labels Oct 18, 2022
@nalchevanidze nalchevanidze changed the title disable automatic type name generation disable automatic __typename selection and fix client runtime errors connected to it Oct 18, 2022
@nalchevanidze nalchevanidze merged commit a5ca49f into main Oct 18, 2022
@nalchevanidze nalchevanidze deleted the disable-atotamatic-typename-selection branch October 18, 2022 19:57
@github-actions github-actions bot mentioned this pull request Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/breaking Breaking Change scope/client morpheus-graphql-client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Morpheus inserts __typename to disambiguate unions. Unexpected '__typename not found on object'
1 participant